﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; 

namespace NTTDATA.BEENChina.CaseMonitor.UI
{
   

    public partial class FormMsg : Form
    {
        

        public FormMsg()
        {
            InitializeComponent();
        }

        private readonly int _maxLineCount = 200;

        public void ShowMessage(string msg)
        {
          


            if (textBoxLog.Lines.Length > _maxLineCount)
            {
                int c = 0;
                for (int i = 0; i < _maxLineCount / 2; i++)
                    c += textBoxLog.Lines[i].Length + Environment.NewLine.Length;

                textBoxLog.Text = textBoxLog.Text.Substring(c);
            }

            textBoxLog.AppendText(Environment.NewLine + msg);

        }
    }
}
